
********************************************************************************
*   Figure 1
*   Number of foreign residents in Italy by area of origin (millions), 1994-2017
*   Source ISTAT : Migrants population 

use "$data\foreign_residents_by_continent_nationality_1993-2016.dta"

replace asia=asia+latin_america
replace africa=africa+asia
replace others=others+africa
replace eu=eu+others
replace irregulars=irregulars+eu

foreach var in others latin_america asia africa eu irregulars {
	replace $_var=$_var/1000000	
}

twoway (line irregulars year, lcolor(black) lpattern(dash)) (area eu year)  (area others year) (area africa year) (area asia year) (area latin_america year) , ///
legend(label(1 "Including irregulars") label(2 "EU") label(3 "Other countries") label(4 "Africa") label(5 "Asia") label(6 "Latin America"))  ///
xlabel(1993(2)2016) ytitle(millions) graphregion(color(white))  plotregion(lcolor(black))


********************************************************************************
*   Figure 2
*   Intermarriage rate and ratio of foreign residents over total population, 1996-2013
*   Source Demo ISTAT: Tavola 3.1 Matrimoni per tipologia di coppia - Anni 1996-2013
*   https://demo.istat.it/tavole/?t=matrimoni&l=it

use "$data\trend_mrate_mig.dta" , clear
label var qm "share of male mig in italy by year"
label var qf "share of female mig in italy by year"

gr twoway (scatter hetw yy, c(l)  color(cranberry) m(S) msize(small)  ) ///
          (scatter heth yy, c(1)  color(edkblue ) m(S) msize(small)  )  ///
          (scatter qf yy, c(l)  color(cranberry) lpattern(dash) lw(thick)  ) ///
          (scatter qm yy, c(1)  color(edkblue ) lpattern(dash) lw(thick)   ) , ///  
graphregion(color(white)) ///
xsca(r(1995(3)2013)) xtick(1995(3)2013) xlab( 1995(3)2013) ///
ysca(r(0 10)) ylab(0(2)10 , grid) ///
legend( r(2) label(1 "Foreign Wife Marriage") ///
label(2 "Foreign Husband Marriage") label(3 "Fem Mig Rate") label(4 "Male Mig Rate") size(*0.79)) ///
ytitle("Marriage and Migration rate" " ", size(*0.9))  xtitle(" " "Year", size(*0.9)) 



********************************************************************************
*   Appendix Figure A5
*   Regular and irregular immigrants, 1991-2013

 use "$data\time_series_bylegalstatus_1991-2013.dta" , clear

 twoway  (connected all_foreigners year , mcolor(cranberry) lcolor(cranberry)) ///
         (connected regulars year , mcolor(dknavy) lcolor(dknavy)) ///
		 (connected irregulars year , mcolor(dkgreen) lcolor(dkgreen)) , ///
ytitle("Millions") xlabel(1991(2)2013 , labsize(small)) xtitle("") ylab(0(1)5 , grid) ///
legend(order(1 "All Foreigners" 2 "Regulars" 3 "Irregulars") cols(3))
